﻿using System;
using System.ComponentModel;
using System.Reflection;
using System.Linq;

namespace FB.Helpers
{
    public static class EmployeeInfoHelper
    {
        public static string FullName(string FirstName, string LastName, string Alias, string ChineseName)
        {

            if (!string.IsNullOrEmpty(LastName) || !string.IsNullOrEmpty(FirstName) || !string.IsNullOrEmpty(Alias))
            {
                var n = string.Format("{0} {1} {2}", LastName, FirstName, Alias);
                return (!string.IsNullOrEmpty(ChineseName)) ?
                    string.Format("{0} ({1})", n, ChineseName)
                    : n;
            }
            else
                return !string.IsNullOrEmpty(ChineseName) ? ChineseName : string.Empty;


            //var n = string.Format("{0} {1} {2}", LastName, FirstName, Alias);
            //return (!string.IsNullOrEmpty(ChineseName)) ?
            //    string.Format("{0} ({1})", n, ChineseName)
            //    : n;
        }


        public static string EnglishName(string FirstName, string LastName, string Alias)
        {
            return string.Format("{0} {1}{2}",
                LastName, FirstName,
                !string.IsNullOrEmpty(Alias) ? ", " + Alias : string.Empty
                );
        }

    }


}
